Using Object Number as unique ID

I have imported the content of an external tool in a new module (through Excel import). In this external tool, the requirement IDs were of the same format as the DOORS Object Number (= section number), and I must keep that same ID in DOORS.

So, I figured I would use the DOORS Object Number as requirement ID for that specific module.

Since I do not want the requirement ID to change, I would like to "freeze" the objects position and only allow adding new objects at the end of each section (or the end of the module for level 1 objects).

Any idea or suggestion on how this can be done ?
sdauphin - Tue Jul 06 07:58:21 EDT 2010

Re: Using Object Number as unique ID
Mathias Mamsch - Tue Jul 06 12:44:54 EDT 2010

urx ... that is an interesting requirement ... I would not recommend to use the object position as a requirement ID, just for the sake of not having to freeze the object position which is very awkward in the long.

If it is no problem to you to use requirement numbers of a different format for the requirements you will be adding in DOORS I suggest you simply copy the requirement numbers to an attribute called "Manual ID" and then use a dxl attribute, which uses the manual id if it is present, otherwise the module prefix and the absolute number.

If this is no way to go, you could:

  • before the user saves the module, check if any object numbers where modified, i.e the manual id attribute is not equal to the object number and not empty.
  • if the manual id attribute is empty, fill it with the object position.

  • if you find an object which has not the right manual id, you need to decide what to do: warn the user that he made a mistake and still save. Force the user to correct the error (which is very awkward for the users).

I don't know a way to freeze the object position, so I guess this might be the only choice you have, if you don't want to use requirement numbers with a different format for the newly created requirements (which I would really really recommend->the object number is no good format anyway, what about a prefix? ).

Hope this helps,

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Using Object Number as unique ID
llandale - Wed Jul 07 16:55:16 EDT 2010

Your external tool creates Requirement IDs that look like this: 3.2.1.0-2? That's the 2nd text object under 3.2.1. Perhaps each of your requiremrents has a Heading associated with it, in which case the paragraph numbers can look good, 3.2.1.2.

As Mathias said, you cannot 'freeze' but you can indeed write a script that checks the imported 'manual numbers' with the current paragraph number in order to detect, after the fact, when something has indeed been inserted. You retain your 'ReqId' attribute.

filtering off
for obj in (current Module) do
{  ReqID = obj."MyImportedRequirementID"
   ParNum = number(obj)
   if (ReqID != ParaNum) 
   {  print identifier(obj) "\t" ParaNum "\t[" ReqID "]\n"
      accept(obj)
   }
   else reject(obj)
}
filtering on

 

  • louie

 

Re: Using Object Number as unique ID
sdauphin - Thu Jul 15 08:59:08 EDT 2010

Thanks for your suggestions. I have implemented the check when closing the module, as well as a warning message when opening it for edition. I have also limited the number of users with write access to the bare minimum ...